$(window).scroll(function(){           
    var scrollTop=document.body.scrollTop||document.documentElement.scrollTop; 
    var ht = $('.logo').height()-50;
    if(scrollTop > ht){
    	$('.header').css('background-color','#595757');
    } else{
    	$('.header').css('background-color','transparent');
    }
}) 
 !(function(doc, win) {
    var docEle = doc.documentElement,//获取html元素
        event = "onorientationchange" in window ? "orientationchange" : "resize",//判断是屏幕旋转还是resize;
        fn = function() {
            var width = docEle.clientWidth;
            width && (docEle.style.fontSize = 1 * (width / 1920) + "px");//设置html的fontSize，随着event的改变而改变。1px
        };
    
    win.addEventListener(event, fn, false);
    doc.addEventListener("DOMContentLoaded", fn, false);

}(document, window));

